// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

body;


// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.

beginstate LOAD_SCEN_STATE;
	//Quests
	init_quest(0, "Deliver Package", "You've been given a package to deliver to Fort Galima, in the southeast corner of the valley. It's supposed to get there as soon as possible.");
	init_quest(1, "Find Graymold", "Sorkeli, the mage in Fort Galima, needs a fresh sprig of graymold. She didn't say where you could find some.");
	init_quest(2, "Spiders!", "Helen, the herb-seller at the Pearl Bridge, told you about some aranea lurking in one of her herb-picking spots. She promised a handsome reward if you could remove them from the area.");
	init_quest(3, "Retrieve Necklace", "One of the survivors of the Hektos blast wants you to retrieve a necklace from the ruins of her house.");
	init_quest(4, "Report Samuel In", "Samuel, a soldier who survived the Hektos blast asked you to tell Lieutenant Newmann that Samuel is still alive. And that he's _a rotten bastard_.");
	init_quest(5, "Wine Salvage", "Karl, the innkeeper of the Sunken Cow Inn (or what's left of it), has asked you to try and retrieve as many bottles of ale and wine as possible from the inn's cellar.");
	init_quest(6, "Solarian Wine", "Karl, the innkeeper of the Sunken Cow Inn (or what's left of it), wants you to try and find a bottle of Solarian wine in the cellar of the ruined inn. He said to look for a locker.");
	init_quest(7, "Grain for Hektos", "Mayor Anderson of Hektos needs you to find someone in the valley willing to supply the survivors of the Hektos explosions with grain, in an effort to rebuild the town's food stores.");
	init_quest(8, "Corpse Retrieval", "Mayor Anderson of Hektos asked you to recover the bodies of those killed in the blasts. Gruesome work.");
	init_quest(9, "Beg for Empire Aid", "Mayor Anderson asked you to travel to Fort Galima and beg the officers there to get Hektos some aid from the Empire.");
	init_quest(10,"Find Miali","Iracos, the weaponsmith of Hektos, wants you to go see if his wife is still alive after being trapped in the forge during the blast. He's too weak to go do it himself.");
	init_quest(11,"Investigate the Ruins","Commander Ylissa wants you to search the ruins of Hektos for any suspicious activity, and report it back to her.");
	init_quest(12,"Investigate Mayor Anderson","Commander Ylissa wants you to find and search Mayor Anderson's private quarters, hoping to find some sort of lead.");
	init_quest(13,"Meet with Private Scott","Commander Ylissa wants you to find a Private Scott at the Pearl Bridge, and to find out what he's learned about the rebels.");
	init_quest(14,"Clear Out Rebels","Private Scott told you the alleged location of the rebels. Simply put, you need to kill them.");

	//Special Items
	init_special_item(0, "Strange Package","This is the package you need to take to Fort Galima. It smells faintly of vinegar, and it has strange runes drawn on the outside. Needless to say, you're not inclined to open it.");
	init_special_item(1, "Iron Key","This is a simple iron key hung on a thin chain. Karl, innkeeper of the Sunken Cow, gave it to you. He said it unlocks a wine locker in the inn's cellar.");
	init_special_item(2, "Solarian Wine","This is a jug of high-quality Solarian wine. The jug looks pretty fragile.");
	init_special_item(3, "Bronze Key","This is a simple-looking key with an Empire emblem on the handle. Commander Ylissa gave it to you so that you could access the mayor's private chambers.");
	init_special_item(4, "Mayor's Journal","This cheap journal was used by Mayor Anderson, and it details his dealings with the rebels.");

	break;


// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.

beginstate START_SCEN_STATE;
	// Initialize boats

	// Initialize a few shops.
	
	// Shop 0 - Miali's armor
	add_item_to_shop(0,26,5);
	add_item_to_shop(0,27,1);
	add_item_to_shop(0,31,7);
	add_item_to_shop(0,32,3);
	add_item_to_shop(0,36,1);
	add_item_to_shop(0,122,10);
	add_item_to_shop(0,123,5);
	add_item_to_shop(0,126,3);
	add_item_to_shop(0,132,6);
	add_item_to_shop(0,133,3);
	add_item_to_shop(0,137,3);
	add_item_to_shop(0,142,5);
	
	// Shop 1 - Iracos's weapons
	add_item_to_shop(1,46,8);
	add_item_to_shop(1,47,6);
	add_item_to_shop(1,51,5);
	add_item_to_shop(1,52,2);
	add_item_to_shop(1,56,3);
	add_item_to_shop(1,66,6);
	add_item_to_shop(1,67,2);
	add_item_to_shop(1,71,3);
	add_item_to_shop(1,101,10);
	add_item_to_shop(1,102,3);
	add_item_to_shop(1,106,7);
	add_item_to_shop(1,107,2);
	add_item_to_shop(1,73,1);
	
	// Shop 2 - tools
	add_item_to_shop(2,170,500);
	add_item_to_shop(2,171,500);
	add_item_to_shop(2,172,30);
	add_item_to_shop(2,174,500);
	add_item_to_shop(2,177,500);
	
	// Shop 3 - missiles
	add_item_to_shop(3,85,500);
	add_item_to_shop(3,86,10);
	add_item_to_shop(3,90,10);
	add_item_to_shop(3,95,3);
	add_item_to_shop(3,100,20);
	add_item_to_shop(3,101,10);
	add_item_to_shop(3,105,10);

	// Shop 4 - potions
	add_item_to_shop(4,220,4);
	add_item_to_shop(4,221,3);
	add_item_to_shop(4,222,3);
	add_item_to_shop(4,223,2);

	// Shop 5 - food
	add_item_to_shop(5,4,500);
	add_item_to_shop(5,6,500);
	add_item_to_shop(5,7,500);
	add_item_to_shop(5,414,500);
	add_item_to_shop(5,415,5);
	add_item_to_shop(5,400,500);

	// Shop 6 - Mitch's fish
	add_item_to_shop(6,11,10);

	// Shop 7 - Will's training
	add_item_to_shop(7,5004,2);
	add_item_to_shop(7,5005,2);
	add_item_to_shop(7,5006,2);
	add_item_to_shop(7,5007,2);
	add_item_to_shop(7,5009,3);
	add_item_to_shop(7,5016,1);
	add_item_to_shop(7,5020,1);
	add_item_to_shop(7,5024,1);

	// Shop 8 - Harrison's grain
	add_item_to_shop(8,419,15);
	add_item_to_shop(8,392,2);

	// Shop 9 - Jess's shoes
	add_item_to_shop(9,111,13);
	add_item_to_shop(9,114,6);
	add_item_to_shop(9,115,1);
	add_item_to_shop(9,321,4);

	// Shop 10 - Tomas' Tools
	add_item_to_shop(10,174,9);
	add_item_to_shop(10,175,1);
	add_item_to_shop(10,171,15);
	add_item_to_shop(10,172,8);
	add_item_to_shop(10,190,3);
	add_item_to_shop(10,372,4);
	add_item_to_shop(10,377,3);

	// Shop 11 - Helen's Herbs & Potions
	add_item_to_shop(11,214,15);
	add_item_to_shop(11,215,17);
	add_item_to_shop(11,216,9);
	add_item_to_shop(11,218,3);
	add_item_to_shop(11,184,2);
	add_item_to_shop(11,220,8);
	add_item_to_shop(11,221,8);
	add_item_to_shop(11,222,4);
	add_item_to_shop(11,223,3);
	add_item_to_shop(11,225,3);

	// Shop 12 - Harrison buying items - LEAVE EMPTY!

	//Fix a few creatures
	//set_creature_type_level(83,18); //Elder aranea, -2 levels
	//set_creature_type_level(71,13); //Aranea, +2 levels

//Set up starting quest
	toggle_quest(0,1);
	change_spec_item(0,1);

break;
 

// This state is called every tick wherever the party is in the scenario.
// You can use the set_state

beginstate START_STATE;

break;

// Place your own states below. Give each a number at least 10.